/**
 *
 * @author Anastasiya
 *
 */

#include "arguments.h"
#include "printing.h"
#include "util.h"
#include "testlib.h"
#include "ozawa.h"
#include <ogdf/basic/Graph.h>
#include <ogdf/basic/List.h>
#include <ogdf/basic/GraphAttributes.h>
#include <windows.h>
#include <tchar.h>
#include <direct.h>
#include <cstring>
#include <iostream>

using namespace ogdf;


using namespace std;


int testResultInstanceCount = 0;
int texWriterInstanceCount = 0;

Arguments* programArguments = NULL;

Printer* printer = NULL;

Algorithm* algorithm1 = NULL;
Algorithm* algorithm2 = NULL;
TestFramework* test = NULL;



void freeMemory();
int main(int argc, char* argv[]){

	programArguments = parseArgs(argc, argv);



	if(programArguments->mode != MODE_VERBOSE){
		Printer::terse = true;
	}

	printer = new Printer(&cout, &cerr);

	algorithm1 = new OzawaAlgorithm();

	test = new TestFramework(algorithm1, algorithm2);
	test->TEX_FILENAME = programArguments->reportFileName;
	test->test(programArguments->outputPath, programArguments->inputPath);

	freeMemory();

	exit("Exiting...");

	return 0;
}



void freeMemory(){

	cout << endl << endl << "===============================" << endl << endl;

	if(programArguments != NULL){
		free(programArguments);
		programArguments = NULL;
		cout << "Free arguments.. [OK]" << endl;
	}

	if(printer != NULL){
		delete printer;
		cout << "Free printer.. [OK]" << endl;
	}

	cout << endl << "===============================" << endl << endl;
}

